#ifndef MODFTPDOWNLOAD_H
#define MODFTPDOWNLOAD_H

#include <QAbstractTableModel>

#include <QList>

class FtpDownloadItem;

class ModFtpDownload : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit ModFtpDownload(QObject *parent = 0);

    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;

    void appendRowItem(FtpDownloadItem* pRowItem);

    void updateState(QString fileName, quint32 fileSize, quint32 currentSize,
                     double speed);
    void resultState(QString fileName, bool bSuccess);
    void clear();

private:
    QList<FtpDownloadItem*> lstRowItem;
};

#endif // MODFTPDOWNLOAD_H
